<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客发布</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.10/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/me.css"> <!--引入自定义CSS样式-->
    <link rel="stylesheet" href="../../static/lib/editor/css/editormd.min.css"><!--引入md编辑器css-->
</head>
<body>
    <!--导航-->
    <nav class="ui inverted attached segment me-padded-tb-mini me-shadow-small"> <!--引入css样式-->
        <div class="ui container">
            <div class="ui inverted secondary menu stackable"><!--stackable可堆叠，解决手机访问-->
                <h2 class="ui teal header item">后台管理</h2> <!--item为menu中的一个条目-->
                <a href="#" class="active m-item item me-mobile-hide"><i class="home icon"></i>博客</a><!--href为超链接-->
                <a href="#" class="m-item item me-mobile-hide"><i class="idea icon"></i>分类</a><!--m-item，在JQuery里获取样式-->
                <a href="#" class="m-item item me-mobile-hide"><i class="tags icon"></i>标签</a>

                <div class="right m-item me-mobile-hide menu">
                    <div class="ui dropdown item">
                        <div class="text">
                            <img src="../../static/images/wechat.jpg" alt="" class="ui avatar image">
                            泽宝宝
                        </div>
                        <i class="dropdown icon"></i>
                        <div class="menu">
                            <a href="#" class="item">注销</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <a href="#" class="ui black icon button me-top-right me-mobile-show menu toggle"> <!--手机端菜单图标, menu toggle获取点击事件-->            <i class="sidebar icon"></i>
        </a>
    </nav>

    <!--二级导航-->
    <div class="ui attached pointing menu"> <!--active的就可以有小箭头-->
        <div class="ui container">
            <div class="right menu">
                <a href="#" class="item">发布</a>
                <a href="#" class="teal active item">列表</a>
            </div>

        </div>

    </div>

    <!--中间内容-->
    <div class="me-container-small me-padded-tb-large">
        <div class="ui container">
            <form action="#" method="post" class="ui form">
                
                <!--标题-->
                <div class="ui required field"><!--required: 不输入为红框-->
                    <div class="ui left labeled input">
                        <div class="ui teal basic label selection dropdown"><!--需要加label-->
                            <input type="hidden" value="原创"><!--默认值-->
                            <i class="dropdown icon"></i>
                            <div class="text">原创</div>
                            <div class="ui teal menu">
                                <div class="item" data-value="原创">原创</div>
                                <div class="item" data-value="转载">转载</div>
                                <div class="item" data-value="翻译">翻译</div>
                            </div>
                        </div>
                        <input type="text" name="title" placeholder="标题">
                    </div>
                </div>

                <!--编辑内容-->
                <div class="field">
                    <div id="md-content" style="z-index: 1 !important;"> <!--最上方显示，全屏覆盖-->
                        <textarea style="display: none" name="content" placeholder="内容" cols="30" rows="10"></textarea>
                    </div>
                </div>

                <!--分类和标签选择-->
                <div class="two fields"><!--field貌似是横着的？-->
                    <div class="field">
                        <div class="ui left labeled action input"><!--action: 标签和下拉框变紧密-->
                            <label class="ui compact teal basic label">分类</label>
                            <div class="ui fluid multiple search selection dropdown"><!--multiple, search 支持多选和搜索-->
                                <input type="hidden" name="type">
                                <i class="dropdown icon"></i>
                                <div class="default text">分类</div>
                                <div class="menu">
                                    <div class="item" data-value="错误日志">错误日志</div>
                                    <div class="item" data-value="开发者手册">开发者手册</div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="field">
                        <div class="ui left labeled action input"><!--action: 标签和下拉框变紧密-->
                            <label class="ui compact teal basic label">标签</label>
                            <div class="ui fluid multiple search selection dropdown">
                                <input type="hidden" name="type">
                                <i class="dropdown icon"></i>
                                <div class="default text">标签</div>
                                <div class="menu">
                                    <div class="item" data-value="Java">Java</div>
                                    <div class="item" data-value="C++">C++</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!--首图引用地址-->
                <div class="field">
                    <div class="ui left labeled input">
                        <label class="ui teal basic label">首图</label>
                        <input type="text" name="indexPicture" placeholder="首图引用地址">
                    </div>
                </div>

                <!--推荐、可转载选择checkbox-->
                <div class="inline fields">
                    <div class="field">
                        <div class="ui checkbox">
                            <input type="checkbox" id="recommend" name="recommend" checked><!--hidden 默认不选中-->
                            <label for="recommend">推荐</label>
                        </div>
                    </div>
                    <div class="field">
                        <div class="ui checkbox">
                            <input type="checkbox" id="shareInfo" name="shareInfo" ><!--hidden 默认不选中-->
                            <label for="shareInfo">可转载</label>
                        </div>
                    </div>
                    <div class="field">
                        <div class="ui checkbox">
                            <input type="checkbox" id="donate" name="donate" class="hidden"><!--hidden 默认不选中-->
                            <label for="donate">可赞赏</label>
                        </div>
                    </div>
                    <div class="field">
                        <div class="ui checkbox">
                            <input type="checkbox" id="comment" name="comment" class="hidden"><!--hidden 默认不选中-->
                            <label for="comment">可留言</label>
                        </div>
                    </div>
                </div>

                <!--提交、返回按钮-->
                <div class="ui right aligned container">
                    <!--onclick内容为哪里来的就返回到哪里-->
                    <button class="ui button" onclick="window.history.go(-1)">返回</button><!--默认事件是提交-->
                    <button class="ui secondary button">保存</button>
                    <button class="ui teal button">发布</button>
                </div>
            </form>
        </div>
    </div>

    <!--底部footer-->
    <footer class="ui inverted vertical segment me-padded-tb-max"><!--vertical消除圆角，用attached好像也行-->
        <div class="ui center aligned container"><!--居中-->
            <div class="ui inverted divided grid stackable"><!--grid stackable默认均匀分成16份, divided分割线-->
                <div class="three wide column">
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../../static/images/wechat.jpg" class="ui rounded image" alt="" style="width: 110px"><!--alt规定图片无法显示时的替代文本-->
                        </div>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header me-text-space me-opacity-mini">最新博客</h4><!--标题-->
                    <div class="ui inverted link list">
                        <a href="#" class="item me-text-thin me-text-lined">用户故事</a>
                        <a href="#" class="item me-text-thin me-text-lined">用户故事</a>
                        <a href="#" class="item me-text-thin me-text-lined">用户故事</a>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header me-text-space me-opacity-mini">联系我</h4><!--标题-->
                    <div class="ui inverted link list">
                        <a href="#" class="item me-text-thin me-text-lined">Email: stg1205@163.com</a>
                        <a href="#" class="item me-text-thin me-text-lined">QQ: 1014922487</a>
                    </div>
                </div>
                <div class="seven wide column">
                    <h4 class="ui inverted header me-text-space me-opacity-mini">介绍</h4>
                    <p class="me-text-space me-text-thin me-text-lined me-opacity-mini">这是我的个人博客，啦啦啦啦啦啦拉拉拉啊拉啦阿拉</p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="me-text-space me-opacity-tiny">Copyright</p>
        </div>

    </footer>
<script
        src="https://code.jquery.com/jquery-3.1.1.min.js"
        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.10/semantic.min.js"></script>
<script src="../../static/lib/editor/editormd.min.js"></script>

    <script>
        $('.menu.toggle').click(function () {
            $('.m-item').toggleClass('me-mobile-hide'); //toggleClass，取反函数
        });

        /*下拉框*/
        $('.ui.dropdown').dropdown({
            on: 'hover' //鼠标放上就触发
        });

        /*表单验证*/
        $('.ui.form').form({
            fields: { //要加s。。。
                title: {
                    identifier: 'title',//与name一致
                    rules: [{
                        type: 'empty',
                        prompt: '标题：请输入博客标题', //提示内容
                    }]
                }
            }
        });

        /*md编辑器初始化*/
        var testEditor;

        $(function() {
            testEditor = editormd("md-content", {
                width: "100%",
                height: 640,
                syncScrolling: "single",
                path: "../static/lib/editor/lib/"
            });
        });
    </script>
</body>
</html>